package route

import (
	"asuOfficialApi/controller/client"
	"asuOfficialApi/service"
	"asuOfficialApi/web/boot"
	"asuOfficialApi/web/middleware"
	"github.com/kataras/iris/mvc"
)

func Configure(b *boot.Bootstrapper) {
	mvc.Configure(b.Party("/client"), user)
}

func user(app *mvc.Application) {
	tokenService := service.NewTokenService()
	app.Router.Use(middleware.New(tokenService))

	userService := service.NewUserService()
	app.Register(userService, tokenService)
	app.Handle(new(client.UserController))
	app.Party("/test").Handle(new(client.TestController))
}
